//
//  TabBarController.swift
//  NetEaseBUFF
//
//  Created by QFX on 2023/10/27.
//

import UIKit

class TabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.        
        self.selectedIndex = 0
        self.tabBarController?.tabBar.backgroundColor = .white
        
        self.tabBar.items?[0].image = UIImage(named: "icon_maintab_home_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[0].selectedImage = UIImage(named: "icon_maintab_home_selected_Normal")!.withRenderingMode(.alwaysOriginal)
        
        self.tabBar.items?[0].title = "BUFF"
        self.tabBar.items?[0].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.black], for: .normal)
        self.tabBar.items?[0].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor(hexString: "#2B73CC")!], for: .selected)
        
        self.tabBar.items?[1].image = UIImage(named: "icon_maintab_discovery_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[1].selectedImage = UIImage(named: "icon_maintab_discovery_selected_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[1].title = "发现"
        self.tabBar.items?[1].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.black], for: .normal)
        self.tabBar.items?[1].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor(hexString: "#2B73CC")!], for: .selected)
        
        
        self.tabBar.items?[2].title = "库存"
        self.tabBar.items?[2].image = UIImage(named: "icon_maintab_mystorage_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[2].selectedImage = UIImage(named: "icon_maintab_mystorage_selected_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[2].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.black], for: .normal)
        self.tabBar.items?[2].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor(hexString: "#2B73CC")!], for: .selected)
        
        
        self.tabBar.items?[3].title = "出售"
        self.tabBar.items?[3].image = UIImage(named: "icon_maintab_myshelf_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[3].selectedImage = UIImage(named: "icon_maintab_myshelf_selected_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[3].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.black], for: .normal)
        self.tabBar.items?[3].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor(hexString: "#2B73CC")!], for: .selected)
        
        
        self.tabBar.items?[4].title = "我的"
        self.tabBar.items?[4].image = UIImage(named: "icon_maintab_me_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[4].selectedImage = UIImage(named: "icon_maintab_me_selected_Normal")!.withRenderingMode(.alwaysOriginal)
        self.tabBar.items?[4].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.black], for: .normal)
        self.tabBar.items?[4].setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor(hexString: "#2B73CC")!], for: .selected)
        
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
